package org.apache.flink.training.exercises.common.datatypes;

import org.apache.flink.training.exercises.common.utils.GeoUtils;

import java.time.Instant;

/**
 * @Author hujf
 * @Date 2022/8/24 13:50
 * @Description TODO
 */
public class EnrichedRide extends TaxiRide{

    public int startCell;
    public int endCell;

    public EnrichedRide() {
    }

    public EnrichedRide(int startCell, int endCell) {
        this.startCell = startCell;
        this.endCell = endCell;
    }


    public EnrichedRide(TaxiRide taxiRide) {
        this.startCell = GeoUtils.mapToGridCell(taxiRide.startLon, taxiRide.startLat);;
        this.endCell = GeoUtils.mapToGridCell(taxiRide.endLon, taxiRide.endLat);;
        this.endLon =taxiRide.endLon;
        this.startLon = taxiRide.startLon;
        this.startLat = taxiRide.startLat;
    }

    @Override
    public String toString() {
        return "EnrichedRide{" +
                "startCell=" + startCell +
                ", endCell=" + endCell +
                ", rideId=" + rideId +
                ", isStart=" + isStart +
                ", eventTime=" + eventTime +
                ", startLon=" + startLon +
                ", startLat=" + startLat +
                ", endLon=" + endLon +
                ", endLat=" + endLat +
                ", passengerCnt=" + passengerCnt +
                ", taxiId=" + taxiId +
                ", driverId=" + driverId +
                '}';
    }
}
